﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System.Collections.Observable.Transaction
{
    public interface ICollectionChangedTransaction
    {
        bool IsTransactionInProgress { get; }

        /// <summary>
        /// Suspends any events about Collection changes to be sent.
        /// All events are merged if possible and saved until EndTransaction is called.
        /// </summary>
        CollectionChangedTransaction BeginTransaction();
        
        /// <summary>
        /// Ends transaction
        /// </summary>
        void EndTransaction(CollectionChangedTransaction transaction);
    }
}
